//scor 2015年9月9日15:06:24
var AV = require('leanengine');
var async = require('async');
var config = require('../config.js');
var CollectM = require('../models/collect');
var log4js = require('log4js');
var logger = log4js.getLogger('normal');
module.exports = {
    getUserCollect:function(req,res){
        var uid=req.AV.user.id
        CollectM.getUserCollect(uid).then(function(obj){
            res.json(obj);
            logger.info(obj);
        }).catch(function(err){
            logger.error(err);
            res.json(err);
        });
    },
    removeUserCollect:function(req,res){
        var uid=req.AV.user.id
        var objectId=req.query.objectId;
        //res.json({a:objectId});
        CollectM.removeUserCollect(uid,objectId).then(function(obj){
            res.json(obj);
            logger.info(obj);
        }).catch(function(err){
            logger.error(err);
            res.json(err);
        });
    }



};